import request from '@/utils/request.js'
// 获取员工
export function sysUse(params) {
  return request({ url: '/sys/user', params })
}
// 新增员工
export function sysUserData(data) {
  return request({ url: '/sys/user', method: 'post', data })
}
// 删除员工
export function sysUserDelete(id) {
  return request({ url: '/sys/user/' + id, method: 'delete' })
}
// 批量导入员工
export function sysUserBatchPost(data) {
  return request({ url: '/sys/user/batch', method: 'post', data })
}
// 获取所有角色
export function sysRole(params) {
  return request({ url: '/sys/role', params })
}
// 给角色分配权限
// export function sysRoleAssignRoles(data) {
//   return request({ url: '/sys/user/assignRoles', method: 'put', data })
// }
// 给员工分配角色
export function sysUserAssignRoles(id, roleIds) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data: { id, roleIds }
  })
}
